package com.ruoyi.zhike.merchant.service.impl;

import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.zhike.db.mapper.MerchantMealInfoMapper;
import com.ruoyi.zhike.db.domain.MerchantMealInfo;
import com.ruoyi.zhike.merchant.service.IMerchantMealInfoService;

import javax.annotation.Resource;

/**
 * 商户套餐信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-17
 */
@Service
public class MerchantMealInfoServiceImpl implements IMerchantMealInfoService 
{
    @Resource
    private MerchantMealInfoMapper merchantMealInfoMapper;

    /**
     * 查询商户套餐信息
     * 
     * @param id 商户套餐信息主键
     * @return 商户套餐信息
     */
    @Override
    public MerchantMealInfo selectMerchantMealInfoById(Long id)
    {
        return merchantMealInfoMapper.selectMerchantMealInfoById(id);
    }

    /**
     * 查询商户套餐信息列表
     * 
     * @param merchantMealInfo 商户套餐信息
     * @return 商户套餐信息
     */
    @Override
    public List<MerchantMealInfo> selectMerchantMealInfoList(MerchantMealInfo merchantMealInfo)
    {
        return merchantMealInfoMapper.selectMerchantMealInfoList(merchantMealInfo);
    }

    /**
     * 查询商户套餐信息列表
     *
     * @param merchantMealInfo 商户套餐信息
     * @return 商户套餐信息
     */
    @Override
    public List<Map<String, Object>> selectMerchantMealInfoListMap(MerchantMealInfo merchantMealInfo)
    {
        return merchantMealInfoMapper.selectMerchantMealInfoListMap(merchantMealInfo);
    }

    /**
     * 新增商户套餐信息
     * 
     * @param merchantMealInfo 商户套餐信息
     * @return 结果
     */
    @Override
    public int insertMerchantMealInfo(MerchantMealInfo merchantMealInfo)
    {
        merchantMealInfo.setCreateTime(DateUtils.getNowDate());
        return merchantMealInfoMapper.insertMerchantMealInfo(merchantMealInfo);
    }

    /**
     * 修改商户套餐信息
     * 
     * @param merchantMealInfo 商户套餐信息
     * @return 结果
     */
    @Override
    public int updateMerchantMealInfo(MerchantMealInfo merchantMealInfo)
    {
        merchantMealInfo.setUpdateTime(DateUtils.getNowDate());
        return merchantMealInfoMapper.updateMerchantMealInfo(merchantMealInfo);
    }

    /**
     * 批量删除商户套餐信息
     * 
     * @param ids 需要删除的商户套餐信息主键
     * @return 结果
     */
    @Override
    public int deleteMerchantMealInfoByIds(Long[] ids)
    {
        return merchantMealInfoMapper.deleteMerchantMealInfoByIds(ids);
    }

    /**
     * 删除商户套餐信息信息
     * 
     * @param id 商户套餐信息主键
     * @return 结果
     */
    @Override
    public int deleteMerchantMealInfoById(Long id)
    {
        return merchantMealInfoMapper.deleteMerchantMealInfoById(id);
    }
}
